define(()=>{
    class Toast{
        constructor(cont){
            this.p = $(".cont").find("p");
            this.cont = cont
            this.addEvent();
        }
        addEvent(){
            const that = this;
            this.p.click(function(){
                that.toast(this)
            })
        }
        toast(tar){
            $("<dialog class='t'>")
            .html($(tar).html())
            .appendTo(this.cont)
            .css({
                display:"block",
                top:0,bottom:0
            })

            clearTimeout(this.t);
            this.t = setTimeout(() => {
                $(".t").remove();
            }, 2000);
        }
    }

    return Toast;
})